Lat/long are absolutes since we have a different hemi field.
authorrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 10 Jan 2006 14:00:55 +0000 (14:00 +0000)
committerrobertl <robertl@f51c46e8-681c-474f-0cfe-069cfd0219fb>
Tue, 10 Jan 2006 14:00:55 +0000 (14:00 +0000)
gpsbabel/compegps.c

index ba20227ad39dff976215b0111e1410fd8ad09e3f..bbdaea47e60e1bac47b7501e29b36d7ae9ad0bd6 100644 (file)
@@ -420,9 +420,9 @@ write_waypt_cb(const waypoint *wpt)
        
        fprintf(fout, "W  %s A ", name);
        fprintf(fout, "%.10f%c%c ",
-               wpt->latitude, 0xBA, (wpt->latitude >= 0) ? 'N' : 'S');
+               fabs(wpt->latitude), 0xBA, (wpt->latitude >= 0) ? 'N' : 'S');
        fprintf(fout, "%.10f%c%c ",
-               wpt->longitude, 0xBA, (wpt->longitude >= 0) ? 'E' : 'W');
+               fabs(wpt->longitude), 0xBA, (wpt->longitude >= 0) ? 'E' : 'W');
        fprintf(fout, "27-MAR-62 00:00:00 %.6f", 
                (wpt->altitude != unknown_alt) ? wpt->altitude : 0.0);
        if (wpt->description != NULL)
@@ -502,8 +502,8 @@ write_trkpt_cb(const waypoint *wpt)
        }
        
        fprintf(fout, "T  A %.10f%c%c %.10f%c%c ",
-               wpt->latitude, 0xBA, (wpt->latitude >= 0) ? 'N' : 'S',
-               wpt->longitude, 0xBA, (wpt->longitude >= 0) ? 'E' : 'W');
+               fabs(wpt->latitude), 0xBA, (wpt->latitude >= 0) ? 'N' : 'S',
+               fabs(wpt->longitude), 0xBA, (wpt->longitude >= 0) ? 'E' : 'W');
        fprintf(fout, "%s s %.1f %.1f %.1f %.1f %d ",
                buff,
                wpt->altitude,